package com.sxt.action;

import com.opensymphony.xwork2.ActionContext;

public class LoginAction {
	private String username;
	private String password;

	public String login() {
		if (null != username && null != password && username.equals("admin")
				&& password.equals("admin")) {
			ActionContext.getContext().getSession().put("currentUser", username);
			return "success";
		}
		return "failed";
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
}
